<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let input = `4
        0 0
        1 2
        3 1
        2 -1        `
        input = input.split('\n').map((v) => { return v.trim() })
        let N = input.shift()
        let str=input        
        input = input.map((v) => { return v.split(' ').map((j) => { return parseInt(j, 10) }) })

        console.log(input);
        let count = 0
        for (let i = 0; i < N; i++) {
            let x1 = input[i][0]
            let y1 = input[i][1]
            for (let j = i+1; j < N; j++) {
                let x2 = input[j][0]
                let y2 = input[j][1]

                // 向量x1,y1 =>x2,y2 : (x2-x1,y2-y1)
                // 推导看图
                // 内积0：(y3-y1)(y2-y1)+(x3-x1)(x2-x1)=0
                // c1、d1点
                let x3_a = y1 - y2 + x1
                let y3_a = x2 - x1 + y1
                let x4_a = x2 + (y1 - y2)
                let y4_a = y2 - (x1 - x2)


                // c2点、d2点
                let x3_b = y2 - y1 + x1
                let y3_b = x1 - x2 + y1
                let x4_b = x2 - (y1 - y2)
                let y4_b = y2 + (x1 - x2)

                if ((str.includes(x3_b+' '+y3_b)&&(str.includes(x4_b+' '+y4_b))||
                str.includes(x3_a+' '+y3_a)&&str.includes(x4_a+' '+y4_a))) {
                    count++
                }

            }
        }
        console.log(count/4);



    </script>
</body>

</html>